<?php 
global $wpdb;

if($sm != '') {
	$status  = isset($_GET['status']) ? $_GET['status'] : 0;  
	
	//get the rows
	$row = $wpdb->query(
			"
			UPDATE ".$wpdb->prefix."hfr_url_craw
				SET active = ".$status."
			WHERE sitemap = '".$sm."'
			"
		);
 		
	//Remove from server hatforrent
	$sql = "SELECT * FROM ".$wpdb->prefix."hfr_url_craw WHERE sitemap = '".$sm."'";
	$data = $wpdb->get_row($sql);
	//Send data to hatforrent server
	if (isset($data) && !empty($data)) {
		
		
		$json = json_encode($data);
		$params = array('data' => $json);
		$hfrUpdateUrl = HFR_SERVER."/rest/update-url-craw";
		$result = hfr_remote_post($hfrUpdateUrl, $params);
	}
		
}

wp_redirect("admin.php?page=hfr_source_manager");

?>
